home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Dev / Sas-PPC / samplelib3 / testppc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  823 b   |  45 lines

  1. #include <proto/dos.h>
  2. #include <proto/exec.h>
  3.  
  4. extern int _b;  /* this will be resolved to the definition of 'b' */
  5.                 /* from the 68k compiler */
  6.  
  7. test1(void)
  8. {
  9.     struct DOSLibrary *DOSBase;
  10.     void *SysBase = *(void **)4;
  11.  
  12.  
  13. printf("in test1\n");
  14.     
  15.     DOSBase = OpenLibrary("dos.library", 0);
  16.     if (DOSBase)
  17.     {
  18.         Write(Output(), "in test1\n", 9);
  19.         CloseLibrary(DOSBase);
  20.     }
  21.     return(_b);
  22. }
  23.  
  24. test2(int a)
  25. {
  26.     struct DOSLibrary *DOSBase;
  27.     void *SysBase = *(void **)4;
  28.     
  29.     DOSBase = OpenLibrary("dos.library", 0);
  30.     if (DOSBase)
  31.     {
  32.         Write(Output(), "in test2\n", 9);
  33.         CloseLibrary(DOSBase);
  34.     }
  35.     _b = a;
  36.     return(_b);
  37. }
  38.  
  39.  
  40.  
  41.  
  42. /* These are so the 68k can access these functions */
  43. int (*__PPC_test1)(void) = test1;
  44. int (*__PPC_test2)(int) = test2;
  45.